<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr02=[2,8,6,3,4,5,10];
        var i=0
        while(i<arr02.length-1){    
            i++;
        var j=arr02.length-1
            while(j>=i){
                j--
                if(arr02[j]<arr02[j-1]){
                 var num=arr02[j];
                    arr02[j]=arr02[j-1];
                   arr02[j-1]=num;
                }
           }
        }
        console.log(arr02);
    </script>
</body>
</html>